import { Component, OnInit } from '@angular/core';
import {UserApi} from "../../../api/UserApi";
import {LoginReq} from "../../../api/UserApi";
@Component({
  selector: 'app-login',
  templateUrl: './login.component.html',
  styleUrls: ['./login.component.scss']
})
export class LoginComponent implements OnInit {

  username:string = ""
  password:string = ""

  constructor() { }

  ngOnInit(): void {
  }

  async doLogin(){

   const result = await UserApi.Login(new LoginReq(this.username!,this.password!));
    if (result.success()) {
      alert("登陆成功!")
    }else{
      result.handlerErrorMsg()
    }
  }
}
